home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: netcom.com!gibson
- From: gibson@netcom.com (Bob Gibson)
- Subject: Q: implicit converstion - error?
- Message-ID: <gibsonDLr0rs.AEB@netcom.com>
- Organization: A number of persons or groups united for some purpose
- X-Newsreader: TIN [version 1.2 PL1]
- Date: Thu, 25 Jan 1996 18:02:16 GMT
- Sender: gibson@netcom11.netcom.com
-
- A friend showed me a compile error that I was able to recreate
- with the following simple example:
-
- --
- void test( const char * * ppc )
- {
- cout << '"' << *ppc << '"' << endl;
- }
-
- int main()
- {
- char * msg = "Example message";
- char * * p = &msg;
-
- test( ppc ); // <- Error
- test( &msg ); // <- Error
-
- }
- --
- OK. Here's the problem. The compiler complains that a
- "char * *" can't / won't be converted to a "const char * *".
- I don't understand the proglem. If the function signature
- says that it will treat the "char * *" in such a was as to
- not change the chars' to which the pointer point, what's
- the problem?
-
- Thanks in advance
-
- Bob
- --
- O.J. Verdict - The best innocence money can buy
-
- Bob Gibson -- gibson@netcom.com
-